﻿using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.UI;
using UnityEngine.Events;

public class UIOnClick : MonoBehaviour
{
    FurniturePlacing furniturePlacing;
    public GameObject panel;
    public GameObject PlaceIndecator;
    void Start()
    {
        furniturePlacing = GameObject.FindGameObjectWithTag("GameController").GetComponent<FurniturePlacing>();
    }

    public void UniversalClick()
    {
        GetComponent<Transform>().localScale = new Vector3(1, 1, 1);
    }

    // Update is called once per frame
    public void starEditingMode()
    {
        furniturePlacing.GetSprite = GetComponent<Image>().sprite;//传入图片
        furniturePlacing.isEditing = true;
        panel.SetActive(false);
        PlaceIndecator.GetComponentInChildren<Image>().sprite = GetComponent<Image>().sprite;
    }

    public void endEditingMode()
    {
        furniturePlacing.GetSprite = null;
        furniturePlacing.isEditing = false;
        panel.SetActive(false);
    }
}
